function renderTable() {

}

function getWidget(widgets) {
	//console.log(widgets)
	    
	if (widgets.length!=0) {
		var wid = widgets[0].attr('wid')
		var wp = widgets[0].attr('wp')
	
		$.ajax({
			url:'http://localhost:8080/widget/render',
	        dataType:'jsonp',
	        //jsonp: "callback",
	        jsonpCallback: "success_callback",
	        data:{
	            wid:wid,
	            wp:wp
	        },
	        success:function(result){
	            console.log("表格")
	            if (result.widgetType=="表格") {
	            	console.log(widgetObject[wid])
	            }
	            widgets.splice(0,1)
	            getWidget(widgets)
	        } ,
	        error:function(err){
	        	console.log(err)
	        	widgets.splice(0,1)
	        	getWidget(widgets)
	        }
	    });

    }

}

var widgetObject = {}

    
$(document).ready(function(){
	var widgetsArray = []
	var widgets = $("[wid]")
    for(var i=0;i<widgets.length;i++) {
	    widgetsArray.push($(widgets[i]))
	    //console.log($(widgets[i]).attr('wid'))
	    widgetObject[$(widgets[i]).attr('wid')] = $(widgets[i])
	}

	//console.log(widgetObject)
	

    getWidget(widgetsArray)
    //var widgets = $("[attribute='token']")
    
});